{
  "name"    : "config.demobrowser.json - does the actual compile jobs, needs a generated config.demo.json",

  "include" :
  [
    {
      "path" : "./config.demo.json",
      "as"   : "demos"
    },
    {
      "path" : "${QOOXDOO_PATH}/tool/data/config/application.json",
      "import" : [
        "info"
      ]
    }

  ],

  "let" :
  {
    "CACHE"        : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache",
    "QOOXDOO_PATH" : "../..",
    "THEME"        : "demobrowser.Theme"
  },

  "jobs" :
  {
    "db-common" :
    {
      "desc"    : "common settings for Demobrowser jobs",

      "let" :
      {
        "APPLICATION"  : "demobrowser",
        "LOCALES"      : [ "en" ]
      },

      "library" :
      [
        {
          "manifest" : "${QOOXDOO_PATH}/component/library/logpane/Manifest.json"
        },

        {
          "manifest" : "${QOOXDOO_PATH}/component/library/versionlabel/Manifest.json"
        },

        {
          "manifest" : "${QOOXDOO_PATH}/framework/Manifest.json"
        },

        {
          "manifest" : "Manifest.json"
        }
      ],

      "include" :
      [
        "${APPLICATION}.Application",
        "${THEME}"
      ],

      "environment" :
      {
        "qx.version" : "${QOOXDOO_VERSION}",
        "qx.revision" : "${QOOXDOO_REVISION}",
        "qx.application" : "${APPLICATION}.Application",
        "qx.theme" : "${THEME}",
        "qx.contrib" : false,
        "qx.allowUrlSettings" : true
      },

      // the next is in since resource copying is done here for the demos as well
      "asset-let" :
      {
        "qx.icontheme" : ["Tango", "Oxygen"],
        "qx.theme"     : ["Indigo"]
      },

      "cache" :
      {
        "compile" : "${CACHE}"
      }
    },


    "source-script" :
    {
      "desc"    : "create includer script of Demobrowser",

      "extend" : ["db-common"],

      "compile-options" :
      {
        "paths"  :
        {
          "file" : "./source/script/${APPLICATION}.js",
          "app-root" : "source"
        },
        "code"   :
        {
          "except" : ["*"]
        }
      },
      "compile" : { "type" : "source" }
    },


    "source-demos" :
    {
      "desc"    : "create source version for each demo",

      "let"    : { "APPLICATION" : "demobrowser.demo" },

      "extend" : ["demos::source"]
    },


    "source" :
    {
      "desc"    : "create source version of Demobrowser",

      "run" :
      [
        "source-script",
        "source-demos"
      ]
    },


    // Repeating this job from base.json, as the original draws in too many
    // macros from base.json's global 'let' (!) 
    "source-hybrid" : 
    {
      "extend"  : [ "source" ],

      "compile-options" :
      {
        "code" : { "=except" : [ "${APPLICATION}.*" ] }
      },

      "compile" : { "type" : "hybrid" }
    },


    "build-script" :
    {
      "desc"    : "create build script of Demobrowser",

      "extend" : ["db-common"],

      "config-warnings" :
      {
        "environment" : [ 
          "non-literal-keys",
          "variants-and-url-settings"
        ]
      },

      "compile-options" :
      {
        "paths" :
        {
          "file": "./build/script/${APPLICATION}.js",
          "app-root" : "./build"
        },
        "code"  :
        {
          "format" : true,
          "except" : [],
          "optimize" : ["basecalls", "variables", "privates", "strings", "variants", "whitespace"]
        }
      },

      "compile" : { "type" : "build" }
    },


    "build-files" :
    {
      "desc"    : "copy files of Demobrowser to build dir",

      "extend" : ["db-common"],

      "copy-files" :
      {
        "files" :
        [
          "index.html",
          "demo"
        ],

        "target" : "build"
      }
    },


    "build-resources":
    {
      "desc"    : "copy necessary resources for Demobrowser/demos to build dir",

      "extend" : ["db-common"],

      // adding libraries that are used by demos, so resources are being picked up
      "library" : 
      [
        { "manifest"   : "${QOOXDOO_PATH}/component/library/formdemo/Manifest.json" },
        { "manifest"   : "${QOOXDOO_PATH}/component/library/datademo/Manifest.json" }
      ],

      "include" :
      [
        "qx.theme.Classic",
        "qx.theme.Simple",
        "qx.theme.Modern",
        "qx.theme.Indigo",
        "demobrowser.demo.*"
      ],

      "copy-resources" :
      {
        "target" : "build"
      }
    },


    "build-demos" :
    {
      "desc"    : "create build version for each demo",

      "extend" : ["demos::build"]
    },


    "build" :
    {
      "desc"    : "create build version of Demobrowser",

      "run" :
      [
        "build-resources",
        "build-files",
        "build-script",
        "build-demos"
      ]
    },

    // -- Debug jobs ----------------------------------------------------------

    "debug-dependencies" :
    {
      "desc"    : "extension job for debugging dependencies",

      "extend" : ["db-common"],
      "include" : ["demobrowser.demo.data.ExtendedTree"],
      "log" :
      {
        "dependencies" : { "type": "using"}
      }
    },

    "debug-privates" :
    {
      "desc"    : "extension job for debugging privates",

      "extend" : ["db-common"],
      "log" :
      {
        "privates" : "on"
      }
    }
  }
}
